<html>

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>微乐</title>
		<meta name="viewport" content="initial-scale=1, maximum-scale=1">
		
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">


		
	</head>
    
    <style type="text/css">
        /**#css_include_sm5#*/
        </style>
   <style type="text/css">
       /**#css_include_sme4#*/
       </style>
   <!--sui-->
   
   
   <script type='text/javascript'>
       //#js_include_zepto3#
       </script>
   <script type='text/javascript'>
       $.config = {
           // 路由功能开关过滤器，返回 false 表示当前点击链接不使用路由
           routerFilter: function($link) {
               return false;
           }
       };
   </script>
   <script type='text/javascript'>
       //#js_include_sm2#
       </script>
   <script type='text/javascript'>
       //#js_include_sme1#
       </script>
   
   
	<script type="text/javascript">
        /**
         *create by 2012-08-25 pm 17:48
         *@author hexinglun@gmail.com
         *BASE64 Encode and Decode By UTF-8 unicode
         *可以和java的BASE64编码和解码互相转化
         */
        (function(){
            var BASE64_MAPPING = [
                'A','B','C','D','E','F','G','H',
                'I','J','K','L','M','N','O','P',
                'Q','R','S','T','U','V','W','X',
                'Y','Z','a','b','c','d','e','f',
                'g','h','i','j','k','l','m','n',
                'o','p','q','r','s','t','u','v',
                'w','x','y','z','0','1','2','3',
                '4','5','6','7','8','9','+','/'
            ];

            /**
             *ascii convert to binary
             */
            var _toBinary = function(ascii){
                var binary = new Array();
                while(ascii > 0){
                    var b = ascii%2;
                    ascii = Math.floor(ascii/2);
                    binary.push(b);
                }
                /*
                var len = binary.length;
                if(6-len > 0){
                    for(var i = 6-len ; i > 0 ; --i){
                        binary.push(0);
                    }
                }*/
                binary.reverse();
                return binary;
            };

            /**
             *binary convert to decimal
             */
            var _toDecimal  = function(binary){
                var dec = 0;
                var p = 0;
                for(var i = binary.length-1 ; i >= 0 ; --i){
                    var b = binary[i];
                    if(b == 1){
                        dec += Math.pow(2 , p);
                    }
                    ++p;
                }
                return dec;
            };

            /**
             *unicode convert to utf-8
             */
            var _toUTF8Binary = function(c , binaryArray){
                var mustLen = (8-(c+1)) + ((c-1)*6);
                var fatLen = binaryArray.length;
                var diff = mustLen - fatLen;
                while(--diff >= 0){
                    binaryArray.unshift(0);
                }
                var binary = [];
                var _c = c;
                while(--_c >= 0){
                    binary.push(1);
                }
                binary.push(0);
                var i = 0 , len = 8 - (c+1);
                for(; i < len ; ++i){
                    binary.push(binaryArray[i]);
                }

                for(var j = 0 ; j < c-1 ; ++j){
                    binary.push(1);
                    binary.push(0);
                    var sum = 6;
                    while(--sum >= 0){
                        binary.push(binaryArray[i++]);
                    }
                }
                return binary;
            };

            var __BASE64 = {
                    /**
                     *BASE64 Encode
                     */
                    encoder:function(str){
                        var base64_Index = [];
                        var binaryArray = [];
                        for(var i = 0 , len = str.length ; i < len ; ++i){
                            var unicode = str.charCodeAt(i);
                            var _tmpBinary = _toBinary(unicode);
                            if(unicode < 0x80){
                                var _tmpdiff = 8 - _tmpBinary.length;
                                while(--_tmpdiff >= 0){
                                    _tmpBinary.unshift(0);
                                }
                                binaryArray = binaryArray.concat(_tmpBinary);
                            }else if(unicode >= 0x80 && unicode <= 0x7FF){
                                binaryArray = binaryArray.concat(_toUTF8Binary(2 , _tmpBinary));
                            }else if(unicode >= 0x800 && unicode <= 0xFFFF){//UTF-8 3byte
                                binaryArray = binaryArray.concat(_toUTF8Binary(3 , _tmpBinary));
                            }else if(unicode >= 0x10000 && unicode <= 0x1FFFFF){//UTF-8 4byte
                                binaryArray = binaryArray.concat(_toUTF8Binary(4 , _tmpBinary));
                            }else if(unicode >= 0x200000 && unicode <= 0x3FFFFFF){//UTF-8 5byte
                                binaryArray = binaryArray.concat(_toUTF8Binary(5 , _tmpBinary));
                            }else if(unicode >= 4000000 && unicode <= 0x7FFFFFFF){//UTF-8 6byte
                                binaryArray = binaryArray.concat(_toUTF8Binary(6 , _tmpBinary));
                            }
                        }

                        var extra_Zero_Count = 0;
                        for(var i = 0 , len = binaryArray.length ; i < len ; i+=6){
                            var diff = (i+6)-len;
                            if(diff == 2){
                                extra_Zero_Count = 2;
                            }else if(diff == 4){
                                extra_Zero_Count = 4;
                            }
                            //if(extra_Zero_Count > 0){
                            //	len += extra_Zero_Count+1;
                            //}
                            var _tmpExtra_Zero_Count = extra_Zero_Count;
                            while(--_tmpExtra_Zero_Count >= 0){
                                binaryArray.push(0);
                            }
                            base64_Index.push(_toDecimal(binaryArray.slice(i , i+6)));
                        }

                        var base64 = '';
                        for(var i = 0 , len = base64_Index.length ; i < len ; ++i){
                            base64 += BASE64_MAPPING[base64_Index[i]];
                        }

                        for(var i = 0 , len = extra_Zero_Count/2 ; i < len ; ++i){
                            base64 += '=';
                        }
                        return base64;
                    },
                    /**
                     *BASE64  Decode for UTF-8
                     */
                    decoder : function(_base64Str){
                        var _len = _base64Str.length;
                        var extra_Zero_Count = 0;
                        /**
                         *计算在进行BASE64编码的时候，补了几个0
                         */
                        if(_base64Str.charAt(_len-1) == '='){
                            //alert(_base64Str.charAt(_len-1));
                            //alert(_base64Str.charAt(_len-2));
                            if(_base64Str.charAt(_len-2) == '='){//两个等号说明补了4个0
                                extra_Zero_Count = 4;
                                _base64Str = _base64Str.substring(0 , _len-2);
                            }else{//一个等号说明补了2个0
                                extra_Zero_Count = 2;
                                _base64Str = _base64Str.substring(0 , _len - 1);
                            }
                        }

                        var binaryArray = [];
                        for(var i = 0 , len = _base64Str.length; i < len ; ++i){
                            var c = _base64Str.charAt(i);
                            for(var j = 0 , size = BASE64_MAPPING.length ; j < size ; ++j){
                                if(c == BASE64_MAPPING[j]){
                                    var _tmp = _toBinary(j);
                                    /*不足6位的补0*/
                                    var _tmpLen = _tmp.length;
                                    if(6-_tmpLen > 0){
                                        for(var k = 6-_tmpLen ; k > 0 ; --k){
                                            _tmp.unshift(0);
                                        }
                                    }
                                    binaryArray = binaryArray.concat(_tmp);
                                    break;
                                }
                            }
                        }

                        if(extra_Zero_Count > 0){
                            binaryArray = binaryArray.slice(0 , binaryArray.length - extra_Zero_Count);
                        }

                        var unicode = [];
                        var unicodeBinary = [];
                        for(var i = 0 , len = binaryArray.length ; i < len ; ){
                            if(binaryArray[i] == 0){
                                unicode=unicode.concat(_toDecimal(binaryArray.slice(i,i+8)));
                                i += 8;
                            }else{
                                var sum = 0;
                                while(i < len){
                                    if(binaryArray[i] == 1){
                                        ++sum;
                                    }else{
                                        break;
                                    }
                                    ++i;
                                }
                                unicodeBinary = unicodeBinary.concat(binaryArray.slice(i+1 , i+8-sum));
                                i += 8 - sum;
                                while(sum > 1){
                                    unicodeBinary = unicodeBinary.concat(binaryArray.slice(i+2 , i+8));
                                    i += 8;
                                    --sum;
                                }
                                unicode = unicode.concat(_toDecimal(unicodeBinary));
                                unicodeBinary = [];
                            }
                        }
                        return unicode;
                    },
                    //将base64反解为字符串
                    decoder2str:function(_base64Str){
                        var unicode = this.decoder(_base64Str);
                        var temp = '';
                        for(var i = 0 , len =  unicode.length ; i < len ;++i){
                              temp += String.fromCharCode(unicode[i]);
                        }
                        return temp;
                    }
            };


            window.BASE64 = __BASE64;
        })();
        </script>
	<style type="text/css">
		body {
			font-family: Helvetica, "Microsoft Yahei", Verdana, Helvetica, SimSun, Arial, "Arial Unicode MS", MingLiu, PMingLiu, "MS Gothic", sans-serief;
			margin: 0;
			padding: 0 8px;
			background-color:rgba(0,0,0,0.0) !important;
			color: #333;
			word-wrap: break-word;
		}
    
    .content,.page,.page-group{
    background-color:rgba(0,0,0,0.0) !important;
    }
		
		p {
			margin-top: 0;
			margin-bottom: 5pt;
			line-height: 1.6em;
		}
		
		#header {
			text-align: center;
			background: transparent url('webBgLine.png') repeat-x scroll center bottom;
			padding-top: 6pt;
			margin-bottom: 5pt;
			-webkit-background-size: 320px 2px;
		}
		
		#header h3 {
			margin-bottom: 0px;
			margin-top: 5px;
			font-size: 14pt;
			padding: 0 5pt;
			color: #464646;
			line-height: 1.3em;
		}
		
		.describe {
			color: #8e8e8e;
			font-size: 12pt;
			padding: 4pt 0;
			color: #333;
		}
		
		#info {
			font-size: 10pt;
			line-height: 1.6;
			color: #787878;
		}
		
		#content {
			font-size: 12pt;
			line-height: 1.8;
		}
		
		#article img {
			width: 100% !important;
			height: auto !important;
		}
		
		div.bimg {
			text-align: center;
			padding: 0;
		}
		
		.photo_title {
			font-weight: bold;
			font-size: 14pt;
			margin-top: 15px;
		}
		
		.langs_cn {
			color: #006200;
		}
		
		audio {
			width: 100%
		}
		
		* {
			-webkit-touch-callout: none;
			/* prevent callout to copy image, etc when tap to hold */
			/*-webkit-text-size-adjust: none;*/
			/* prevent webkit from resizing text to fit */
			-webkit-tap-highlight-color: rgba(0, 0, 0, 0.15);
			/* make transparent link selection, adjust last value opacity 0 to 1.0 */
			/*-webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */
		}
		
		@media screen and (-webkit-device-pixel-ratio: 2) {
			#header {
				background-image: transparent url('webBgLine@2x.png') repeat-x scroll center bottom;
				-webkit-background-size: 320px 1px;
			}
		}
	</style>

	<body>
		<div class="page-group">
			<div class="page">

				<div class="content">

					<div id="product_title" style="color: #F58F2D; padding: 0.1rem ; display: inline-block;">ddd</div>
					<div id="product_code" style="color: #666; padding: 0.1rem ; display: inline-block;">ddd</div>

					<img id="product_img" style="width: 100%; height: auto;" />

					<div id="product_imgtyps">

						<!--<div style="width: 33.33%;float: left;">
                         <a href="#" class="button button-fill" style="margin: 0.1rem; ">fill button </a>
                         </div>
                         
                         <div style="clear: both;"></div>-->
					</div>
					<div id="article" style="margin: 8px; margin-bottom: 0.7rem;">

						<div style="color: #333; padding: 0.1rem ; display: inline-block;  ">项目概览：</div>

						<div id="article_content">

						</div>
					</div>
					<!--↑文章end-->
				</div>
				<!--↑content-->

			</div>
		</div>
		
		<script type="text/javascript ">
			$(function() {
				$.init();
				loadDataSuccess(xxx);
			})
		</script>

		<script type="text/javascript">
			var id = getValueForUrl(window.location.toString(), 'pid');
			//			alert(id);
			function getValueForUrl(Url, key) {
				if(Url == null || key == null) return null;
				var index = Url.indexOf(key + "=");
				if(index == -1) {
					return null;
				} else {
					var value = Url.substring(index + (key.length + 1), Url.length);
					value = value.split("&")[0];
					return value;
				}
			}


        
			function loadDataSuccess(json){
				json=BASE64.decoder2str(json);
				//console.log(json);
						$.hideIndicator();
						var jsonData = eval('(' + json + ')');
						if(jsonData.res == 0) { //失败
//							console.log(json);
							$.alert(jsonData.msg);
						} else {
							$(".content").show()
							initData(jsonData.data);
						}
						return ""
			}
			function initData(data) {
				$("#product_title").text(data.promodel.goodsName)
				$("#product_code").text(data.promodel.goodsCode)

				$("#article_content").empty();
				$("#article_content").append(data.promodel.goodsDetail);

				$("#product_img").attr("src", data.promodel.proimg)

				var imageTypes = data.pictype;
				if(imageTypes) {
					var html = ""

					var recordsSize = imageTypes.length;
					for(var i = 0; i < recordsSize; i++) {
						html += "<div style=\"width: 33.33%;float: left;\">" +
							"<a href=\"javascript:onImageTypeClick("+imageTypes[i].Id+")\" class=\"button button-fill\" style=\"margin: 0.02rem; border-radius:0px; background-color:rgba(0,92,104,0.3);color:#215059 \">" + imageTypes[i].Title + " </a>" +
							"</div>";
					}
					html += "<div style=\"clear: both;\"></div>";
					$("#product_imgtyps").append(html);
				}

				//				var objs = document.getElementsByTagName('img');
				//				for(var i = 0; i < objs.length; i++) {
				//					objs[i].onclick = function() {
				//						var myPhotoBrowserPopup = $.photoBrowser({
				//							photos: [
				//								this.src
				//							],
				//							type: 'popup'
				//						});
				//						myPhotoBrowserPopup.open();
				//					}
				//				}
			}

			function onImageTypeClick(id) {
				window.location.href="ios_click_image_type:"+id

			}
		</script>
	</body>

</html>
